<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<style>
  .box{
    width: 500px;
    height: 500px;
    background: url('../imgs/Ruler.20200525080000.000.WindMean.nc.png');
  }
</style>
<body>
  <div class="box">

  </div>
  <script>
    function isOkString(str) {
      const map = {
        ']': '[',
        ')': '(',
        '}': '{',
      }

      const stack = []
      const arr = str.split('')

      for(let i = 0; i< arr.length; i++){
        const item = arr[i]
        if( item === '(' || item === '[' || item === '{') {
          stack.push(item)
        }else{
          if( map[item] != stack.pop() ) {
            return false
          }
        }
      }
      return stack.length === 0
    }

    console.log(isOkString('{]'))
  </script>
</body>
</html>